Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove serverAddress from Feeds and FeedEpisodes URLs #3692

Merged
merged 5 commits into from
Dec 8, 2024

Conversation

mikiher
Copy link
Contributor

@mikiher mikiher commented Dec 7, 2024

Brief summary

This fixes #3563, and also makes the necessary preparation for subdirectory support for RSS feeds.

Which issue is fixed?

Fixes #3563

In-depth Description

This removes the protocol and host from all URLs in the Feeds and FeedEpisodes tables (including a migration that changes existing records). The host and protocol are now dynamically determined at runtime based on the request.

The web client is also modified to handle the shortened URLs.

This achieves 2 goals:

  1. It fixes the issues described in [Bug]: RSS Feeds created using a different server address are inaccessible #3563
  2. It enables subdirectory support by properly accounting for the subdirectory in generated URLs.

How have you tested this?

The migration (both up and down) has been unit tested and also tested against a real ABS database.

Modifications to server and client were tested with both existing (non-subdirectory) and subdirectory builds. The server and client were accessed through different server addresses and behaved correctly:

  • RSS feed modals displaying the correct URL
  • URLs inside the RSS feed are pointing at the right server, including subdirectory (if exists).
  • Images on the RSS Feeds config page are all displayed correctly

@mikiher mikiher marked this pull request as ready for review December 7, 2024 17:54
@mikiher
Copy link
Contributor Author

mikiher commented Dec 7, 2024

Note: I have not deleted the serverAddress column in the feeds table, and it is still set when creating new RSS feeds. While it's not used anymore in the code, it is stored in order to be used in downward migrations. If there are no issues with the new code, we can decide to remove it in some future migration.

server/Server.js Outdated Show resolved Hide resolved
server/objects/Feed.js Outdated Show resolved Hide resolved
@mikiher
Copy link
Contributor Author

mikiher commented Dec 8, 2024

I fixed the two issues you mentioned. PTAL again.

@advplyr
Copy link
Owner

advplyr commented Dec 8, 2024

Working well with & without router base path. Thanks!

@advplyr advplyr merged commit 726adbb into advplyr:master Dec 8, 2024
5 checks passed
@mikiher mikiher deleted the rss-remove-server-address branch December 8, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: RSS Feeds created using a different server address are inaccessible
2 participants